package kr.hkit.androidcomplete02.ch13;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarEx extends Activity {
	
	ProgressBar mProgBar;
	ProgressBar mProgCircle;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_prograssbar);
		
		mProgBar = (ProgressBar)findViewById(R.id.progress);
		mProgCircle = (ProgressBar)findViewById(R.id.progcircle);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.ch13_dec_first:
			mProgBar.incrementProgressBy(-2);
			break;
			
		case R.id.ch13_inc_first:
			mProgBar.incrementProgressBy(2);
			break;
			
		case R.id.ch13_dec_second:
			mProgBar.incrementSecondaryProgressBy(-2);
			break;
			
		case R.id.ch13_inc_second:
			mProgBar.incrementSecondaryProgressBy(2);
			break;
			
		case R.id.ch13_start:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
			
		case R.id.ch13_stop:
			mProgCircle.setVisibility(View.INVISIBLE);
			break;
		}
	}
}
